package net.disy.cadenza.repository.workflow;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Template {
	public static String TEMPLATE_TYPE = "type";
	public static String TEMPLATE_NAME = "name";
	private String type;
	private String name;
	
	public Template(Node templateNode){
		NamedNodeMap namedNodeMap = templateNode.getAttributes();
		Node attrNode = namedNodeMap.getNamedItem(TEMPLATE_TYPE);
		type = (attrNode != null) ? attrNode.getNodeValue() : "";
		attrNode = namedNodeMap.getNamedItem(TEMPLATE_NAME);
		name = (attrNode != null) ? attrNode.getNodeValue() : "";
	}

	public String getType() {
		return type;
	}

	public String getName() {
		return name;
	}

}
